<?php

namespace app\index\validate;

use think\Validate;

/**
 * Class User
 * @package app\index\validate
 */
class User extends Validate
{
    protected $rule = [
        'username|用户名' => 'require',
        'password|密码' => 'require',
        'email|邮箱' => 'require|email',
        'nickname|昵称' => 'require'
    ];

    protected $scene = [
        // 登录
        'login' => [
            'username',
            'password'
        ],
        // 注册
        'register' => [
            'username',
            'username' => 'unique:user',
            'password',
            'email',
            'nickname'
        ],
        // 更新
        'update' => [
            'email' => 'email'
        ]
    ];
}
